package com.example.dao.impl;

import com.example.dao.UserDao;
import com.example.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

@Repository("userDao")
public class UserDaoImpl implements UserDao {
    @Override
    public void save() {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
                User user= (User) applicationContext.getBean("user");
        System.out.println(user);
        System.out.println("执行UserDaoImpl中的save方法");
    }
}
